home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / BASIC / LIB / EVENTSHELL / EXTENSION / ColourPick (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1996-02-11  |  20KB  |  436 lines

  1.  Module ColourPick
  2.  -----------------------------------------------------------------------
  3.  ColourPick Handling Routines (version 1.13 11-Feb-96)
  4.  This library contains routines that implement a 24 bit colour
  5.  chooser dialog box. If the Acorn module 'Colour Picker' is loaded
  6.  (part of Risc OS 3.5 but it will work with 3.1) then you have the
  7.  choice of which dialog box to use. The EvntShell version is a little
  8.  smaller and has a few more features although it only supports the
  9.  RGB colour model. Default behaviour is to use the Acorn version.
  10.  -----------------------------------------------------------------------
  11.  Public Methods Supported:
  12.    FN_shell_ColourPick_Init              Initialises module
  13.    FNshell_ColourPickerModuleLoaded      Checks whether Acorn module is loaded
  14.    FNshell_ColourPickerUsingStandard
  15.    PROCshell_AttachPopupColourPicker     Attaches the ColourPicker to a window/icon
  16.    PROCshell_ColourPickerAllowColourNone
  17.    PROCshell_ColourPickerSetColour
  18.    PROCshell_ColourPickerUseNonStandard
  19.    PROCshell_ColourPickerUseStandard
  20.  Responses to events raised by other modules
  21.    PROCshell_ColourPickerOpen 
  22.  Private Methods Supported:
  23.    PROCshell_ColourPickerSelection
  24.    FN_ColourPicker_PreOpen
  25.    FN_ColourPicker_Redraw
  26.    FN_ColourPicker_SliderChanged
  27.    FN_ColourPicker_ClickSelect
  28.    FN_ColourPicker_ClickAdjust
  29.    FN_ColourPicker_IconWatch1
  30.    FN_ColourPicker_IconWatch2
  31.    FN_ColourPicker_IconWatch3
  32.  Message Strings required by module
  33. *$*|Start FN_shell_ColourPick_Init
  34. _shell_ColourPick_Init
  35.  ON ERROR MODE 12:SYS "Hourglass_Smash":PRINT REPORT$;" at line "+STR$ ERL:END
  36.  Define Constants
  37. /J_c_ColourPick_WindowName$       = "Colour24"   : 
  38.  Template identifier
  39.  Define module variables
  40. 2@_m_ColourPick_DBoxHandle%     = -1    : 
  41.  DBox window handle
  42. 3d_m_ColourPick_NotifyFN$       = ""    : 
  43.  FN to call when selection is made in colourpicker dbox
  44. 4^_m_ColourPick_PreOpenFN$      = ""    : 
  45.  User FN to call before opening colourpicker dbox
  46. 5V_m_ColourPick_WindowHandle%   = -1    : 
  47.  Handle of window containing display icon
  48. 6[_m_ColourPick_DisplayIcon%    = -1    : 
  49.  Handle of icon to display resulting selection
  50. 7=_m_ColourPick_SliderR%        = -1    : 
  51.  Slider Handle R
  52. 8=_m_ColourPick_SliderB%        = -1    : 
  53.  Slider Handle G
  54. 9=_m_ColourPick_SliderG%        = -1    : 
  55.  Slider Handle B
  56. :o_m_ColourPick_R_Value         = 100   : 
  57.  Initial Red   % value (in case the programmer forgets to set it!)
  58. ;K_m_ColourPick_G_Value         = 100   : 
  59.  Initial Green % value (ditto)
  60. <K_m_ColourPick_B_Value         = 100   : 
  61.  Initial Blue  % value (ditto)
  62. >&_m_ColourPick_First_Col_Icon% = 24
  63. ?&_m_ColourPick_Last_Col_Icon%  = 39
  64. @&_m_ColourPick_None_Icon%      = 23
  65. A%_m_ColourPick_OK_Icon%        = 0
  66. B%_m_ColourPick_Cancel_Icon%    = 1
  67. D%_m_ColourPick_AllowNone%      = 
  68. E%_m_ColourPick_EvntsAttached%  = 
  69. G%_m_ColourPick_UseRGBModel%    = 0
  70. H&_m_ColourPick_DialogHandle%   = -1
  71. I&_m_ColourPick_DBoxHandle%     = -1
  72. K^_m_ColourPick_Patch_X_Min%    = 200   : 
  73.  Position of colour patch relative to DBox origin
  74. L(_m_ColourPick_Patch_Y_Min%    = -300
  75. M'_m_ColourPick_Patch_X_Max%    = 450
  76. N(_m_ColourPick_Patch_Y_Max%    = -250
  77. P _m_ColourPick_OSVarLen%  = 2
  78. Q!_m_ColourPick_OSVarTerm% = 13
  79.  _m_ColourPick_OSVarBuffer% _m_ColourPick_OSVarLen%
  80.  Workspace for calls to ColourPicker module..
  81.  _m_ColourPick_WorkSpace% 44
  82.  Initialise Dialog Box title..
  83. X#_m_ColourPick_TitleLength% = 20
  84.  _m_ColourPick_Title%     _m_ColourPick_TitleLength%
  85. Z2$_m_ColourPick_Title%      = "Colour" + 
  86. ( 0 )
  87.  Set default dialog box depending on whether Acorn version is available
  88. shell_ColourPickerUseStandard
  89.  _m_ColourPick_PaletteBlk% 4
  90. c%*|extract FN_ColourPicker_PreOpen
  91. d)*|extract PROC_ColourPicker_Selection
  92. e$*|extract FN_ColourPicker_Redraw
  93. f+*|extract FN_ColourPicker_SliderChanged
  94. g)*|extract FN_ColourPicker_ClickSelect
  95. h)*|extract FN_ColourPicker_ClickAdjust
  96. i(*|extract FN_ColourPicker_IconWatch1
  97. j(*|extract FN_ColourPicker_IconWatch2
  98. k(*|extract FN_ColourPicker_IconWatch3
  99. m#*|Stop FN_shell_ColourPick_Init
  100. q1*|Start PROCshell_ColourPickerAllowColourNone
  101. shell_ColourPickerAllowColourNone( flag% )
  102.  flag% = 
  103. t"  _m_ColourPick_AllowNone% = 
  104. v"  _m_ColourPick_AllowNone% = 
  105. z0*|Stop PROCshell_ColourPickerAllowColourNone
  106. ~-*|Start PROCshell_AttachPopupColourPicker
  107. shell_AttachPopupColourPicker( wh%, menuic%, dispic%, notify_fn$, preopen_FN$ )
  108. shell_WindowLoaded( _c_ColourPick_WindowName$ ) 
  109.  wh% > 0 
  110.  menuic% >= 0 
  111. shell_IconSetButtonType( wh%, menuic%, 3 )
  112. shell_EvntAdd_PopUpMenu( 
  113. shell_GetWindowIdentifier( wh% ), menuic%, dispic%, -1, notify_fn$, preopen_FN$, _POPUP_TYPE_COLOUR24 )
  114.  99, 
  115. shell_MessageOneArg( "SHELLMSG37", _c_ColourPick_WindowName$ )
  116. ,*|Stop PROCshell_AttachPopupColourPicker
  117. &*|Start PROCshell_ColourPickerOpen
  118. shell_ColourPickerOpen( window_handle%, display_icon%, menu_icon%, notify_FN$, preopen_FN$ )
  119.  Opens the ColourPicker dbox and calls the specified routine when a selection
  120.  is made.
  121.  colourpicker_flags%, palette_entry%
  122.  "Hourglass_On"
  123. (_m_ColourPick_NotifyFN$ = notify_FN$
  124. shell_ColourPickerUsingStandard = 
  125. 2  _m_ColourPick_WindowHandle% = window_handle%
  126. 1  _m_ColourPick_DisplayIcon%  = display_icon%
  127. /  _m_ColourPick_PreOpenFN$    = preopen_FN$
  128. shell_OpenWindowDynamic( _c_ColourPick_WindowName$, "_ColourPicker_PreOpen", "" )
  129. ?  _m_ColourPick_DBoxHandle% = 
  130. shell_GetDynamicWindowHandle
  131.  Set up colour picker block (see PRM 5-247)
  132. 8  colourpicker_flags% = 1 :
  133.  dialog box is transient
  134.  _m_ColourPick_AllowNone% = 
  135. %    !_m_ColourPick_WorkSpace% = 1
  136. %    !_m_ColourPick_WorkSpace% = 0
  137. shell_IconGetBoundingBox( window_handle%, menu_icon%, xmin%, ymin%, xmax%, ymax% )
  138. 8  _m_ColourPick_WorkSpace%!04 = _m_ColourPick_Title%
  139. )  _m_ColourPick_WorkSpace%!08 = xmax%
  140. ?  _m_ColourPick_WorkSpace%!12 = &80000000  :
  141.  Reserved word
  142. ?  _m_ColourPick_WorkSpace%!16 = &7FFFFFFF  :
  143.  Reserved word
  144. )  _m_ColourPick_WorkSpace%!20 = ymin%
  145. ?  _m_ColourPick_WorkSpace%!24 = 0          :
  146.  Reserved word
  147. ?  _m_ColourPick_WorkSpace%!28 = 0          :
  148.  Reserved word
  149.   palette_entry% = ( ( _m_ColourPick_B_Value * 2.55 ) << 24 ) + ( ( _m_ColourPick_G_Value * 2.55 ) << 16 ) + ( ( _m_ColourPick_R_Value * 2.55 )<< 8 )
  150. 2  _m_ColourPick_WorkSpace%!32 = palette_entry%
  151. J  _m_ColourPick_WorkSpace%!36 = 0 : 
  152.  size of optional extension block
  153.  _m_ColourPick_WorkSpace%!40 =  _m_ColourPick_UseRGBModel%
  154.  "ColourPicker_OpenDialogue", colourpicker_flags%, _m_ColourPick_WorkSpace% 
  155.  _m_ColourPick_DialogHandle%, _m_ColourPick_DBoxHandle%
  156.  SYS "ColourPicker_UpdateDialogue", 1 << 6, _m_ColourPick_DialogHandle%, _m_ColourPick_WorkSpace%
  157. shell_WindowMoveToPopUpPos( window_handle%, menu_icon%, _m_ColourPick_DBoxHandle% )
  158.  "Hourglass_Off"
  159. %*|Stop PROCshell_ColourPickerOpen
  160. #*|Start FN_ColourPicker_PreOpen
  161. _ColourPicker_PreOpen( window_handle% )
  162.  void%
  163. shell_ColourPickerUsingStandard = 
  164. 0  _m_ColourPick_DBoxHandle% = window_handle%
  165.  _m_ColourPick_EvntsAttached% = 
  166.     _m_ColourPick_SliderR% = 
  167. shell_AttachSliderHandler(_m_ColourPick_DBoxHandle%,5,6,2,8,7,"_ColourPicker_SliderR_Changed")
  168.     _m_ColourPick_SliderG% = 
  169. shell_AttachSliderHandler(_m_ColourPick_DBoxHandle%,12,13,9,15,14,"_ColourPicker_SliderG_Changed")
  170.     _m_ColourPick_SliderB% = 
  171. shell_AttachSliderHandler(_m_ColourPick_DBoxHandle%,19,20,16,22,21,"_ColourPicker_SliderB_Changed")
  172. ^    
  173. shell_AttachClickSelect( _m_ColourPick_DBoxHandle%, -1, "_ColourPicker_ClickSelect" )
  174. ]    
  175. shell_AttachClickAdjust( _m_ColourPick_DBoxHandle%, 0, "_ColourPicker_ClickAdjust" )
  176. T    
  177. shell_AttachUserRedraw( _m_ColourPick_DBoxHandle%, "_ColourPicker_Redraw" )
  178. H    
  179. shell_AttachHelpTag( _m_ColourPick_DBoxHandle%, -1, "c24dbox" )
  180. Y    
  181. shell_AttachIconWatch( _m_ColourPick_DBoxHandle%, 02, "_ColourPick_IconWatch1" )
  182. Y    
  183. shell_AttachIconWatch( _m_ColourPick_DBoxHandle%, 09, "_ColourPick_IconWatch2" )
  184. Y    
  185. shell_AttachIconWatch( _m_ColourPick_DBoxHandle%, 16, "_ColourPick_IconWatch3" )
  186. (    _m_ColourPick_EvntsAttached% = 
  187.  PROCshell_SliderSetValue( _m_ColourPick_SliderR%, _m_ColourPick_R_Value )
  188.  PROCshell_SliderSetValue( _m_ColourPick_SliderG%, _m_ColourPick_G_Value )
  189.  PROCshell_SliderSetValue( _m_ColourPick_SliderB%, _m_ColourPick_B_Value )
  190.  Call User PreOpen FN here...
  191.  _m_ColourPick_PreOpenFN$ <> "" 
  192. U    void% = 
  193. ( "FN" + _m_ColourPick_PreOpenFN$ + "( " + 
  194.  window_handle% + " )" )
  195.  _m_ColourPick_AllowNone% = 
  196. \    
  197. shell_IconSetUnselectable( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon%, 0 )
  198. V    
  199. shell_IconUnselectable( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% )
  200. "*|Stop FN_ColourPicker_PreOpen
  201. +*|Start FN_ColourPicker_SliderR_Changed
  202. _ColourPicker_SliderR_Changed( value% )
  203. shell_ColourPickerUsingStandard = 
  204.  _m_ColourPick_DBoxHandle% <> -1 
  205.  PROCshell_SliderSetValue( _m_ColourPick_SliderR%, value% )
  206. shell_IconDeselect( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% )
  207.  "Wimp_ForceRedraw", _m_ColourPick_DBoxHandle%, _m_ColourPick_Patch_X_Min%, _m_ColourPick_Patch_Y_Min%, _m_ColourPick_Patch_X_Max% + 4, _m_ColourPick_Patch_Y_Max% + 4
  208. **|Stop FN_ColourPicker_SliderR_Changed
  209. +*|Start FN_ColourPicker_SliderG_Changed
  210. _ColourPicker_SliderG_Changed( value% )
  211. shell_ColourPickerUsingStandard = 
  212.  _m_ColourPick_DBoxHandle% <> -1 
  213.  PROCshell_SliderSetValue( _m_ColourPick_SliderG%, value% )
  214. $  _m_ColourPick_G_Value = value%
  215. shell_IconDeselect( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% )
  216.  "Wimp_ForceRedraw", _m_ColourPick_DBoxHandle%, _m_ColourPick_Patch_X_Min%, _m_ColourPick_Patch_Y_Min%, _m_ColourPick_Patch_X_Max% + 4, _m_ColourPick_Patch_Y_Max% + 4
  217. **|Stop FN_ColourPicker_SliderG_Changed
  218. +*|Start FN_ColourPicker_SliderB_Changed
  219. _ColourPicker_SliderB_Changed( value% )
  220. shell_ColourPickerUsingStandard = 
  221.  _m_ColourPick_DBoxHandle% <> -1 
  222.  PROCshell_SliderSetValue( _m_ColourPick_SliderB%, value% )
  223. $  _m_ColourPick_B_Value = value%
  224. shell_IconDeselect( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% )
  225.  "Wimp_ForceRedraw", _m_ColourPick_DBoxHandle%, _m_ColourPick_Patch_X_Min%, _m_ColourPick_Patch_Y_Min%, _m_ColourPick_Patch_X_Max% + 4, _m_ColourPick_Patch_Y_Max% + 4
  226. **|Stop FN_ColourPicker_SliderB_Changed
  227. '*|Start FN_ColourPicker_ClickSelect
  228. _ColourPicker_ClickSelect( window_handle%, icon_handle% )
  229.  wimp_colour_nr%, R_Value, G_Value, B_Value, Palette_Entry%
  230.  icon_handle% = _m_ColourPick_Cancel_Icon% 
  231. shell_CloseWindow( window_handle% )
  232.  icon_handle% = _m_ColourPick_OK_Icon% 
  233. shell_IsIconSelected( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% ) 
  234.     R_Value = -1
  235.     G_Value = -1
  236.     B_Value = -1
  237. %A    R_Value = 
  238. shell_SliderGetValue( _m_ColourPick_SliderR% )
  239. &A    G_Value = 
  240. shell_SliderGetValue( _m_ColourPick_SliderG% )
  241. 'A    B_Value = 
  242. shell_SliderGetValue( _m_ColourPick_SliderB% )
  243.  _m_ColourPick_NotifyFN$ <> "" 
  244. +r    void% = 
  245. ( "FN" + _m_ColourPick_NotifyFN$ + "( " + 
  246.  R_Value + ", " + 
  247.  G_Value + ", "+ 
  248.  B_Value + " )" )
  249.  icon_handle% = _m_ColourPick_None_Icon% 
  250.  "Wimp_ForceRedraw", _m_ColourPick_DBoxHandle%, _m_ColourPick_Patch_X_Min%, _m_ColourPick_Patch_Y_Min%, _m_ColourPick_Patch_X_Max% + 4, _m_ColourPick_Patch_Y_Max% + 4
  251.  icon_handle% >= _m_ColourPick_First_Col_Icon% 
  252.  icon_handle% <= _m_ColourPick_Last_Col_Icon% 
  253. 5D  wimp_colour_nr% = icon_handle% - _m_ColourPick_First_Col_Icon%
  254.  wimp_colour_nr% = 0  
  255.  R_Value = 100  :G_Value = 100  :B_Value = 100
  256.  wimp_colour_nr% = 1  
  257.  R_Value = 86.7 :G_Value = 86.7 :B_Value = 86.7
  258.  wimp_colour_nr% = 2  
  259.  R_Value = 73.3 :G_Value = 73.3 :B_Value = 73.3
  260.  wimp_colour_nr% = 3  
  261.  R_Value = 60   :G_Value = 60   :B_Value = 60
  262.  wimp_colour_nr% = 4  
  263.  R_Value = 46.6 :G_Value = 46.6 :B_Value = 46.6
  264.  wimp_colour_nr% = 5  
  265.  R_Value = 33.3 :G_Value = 33.3 :B_Value = 33.3
  266.  wimp_colour_nr% = 6  
  267.  R_Value = 20   :G_Value = 20   :B_Value = 20
  268.  wimp_colour_nr% = 7  
  269.  R_Value = 0    :G_Value = 0    :B_Value = 0
  270.  wimp_colour_nr% = 8  
  271.  R_Value = 0    :G_Value = 26.6 :B_Value = 60
  272.  wimp_colour_nr% = 9  
  273.  R_Value = 93.3 :G_Value = 93.3 :B_Value = 0
  274.  wimp_colour_nr% = 10 
  275.  R_Value = 0    :G_Value = 80   :B_Value = 0
  276.  wimp_colour_nr% = 11 
  277.  R_Value = 86.7 :G_Value = 0    :B_Value = 0
  278.  wimp_colour_nr% = 12 
  279.  R_Value = 93.3 :G_Value = 93.3 :B_Value = 73.3
  280.  wimp_colour_nr% = 13 
  281.  R_Value = 33.3 :G_Value = 53.3 :B_Value = 0
  282.  wimp_colour_nr% = 14 
  283.  R_Value = 100  :G_Value = 73.3 :B_Value = 0
  284.  wimp_colour_nr% = 15 
  285.  R_Value = 0    :G_Value = 73.3 :B_Value = 100
  286. shell_SliderSetValue( _m_ColourPick_SliderR%, R_Value )
  287. shell_SliderSetValue( _m_ColourPick_SliderG%, G_Value )
  288. shell_SliderSetValue( _m_ColourPick_SliderB%, B_Value )
  289. shell_IconDeselect( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% )
  290.  "Wimp_ForceRedraw", _m_ColourPick_DBoxHandle%, 200, -300, 450, -240
  291. M&*|Stop FN_ColourPicker_ClickSelect
  292. Q'*|Start FN_ColourPicker_ClickAdjust
  293. _ColourPicker_ClickAdjust( window_handle%, icon_handle% )
  294.  R_Value, G_Value, B_Value, void%
  295.   icon_handle% 
  296.   _m_ColourPick_OK_Icon%
  297. XX    
  298. shell_IsIconSelected( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% ) 
  299.       R_Value = -1
  300.       G_Value = -1
  301.       B_Value = -1
  302. \        
  303. ]C      R_Value = 
  304. shell_SliderGetValue( _m_ColourPick_SliderR% )
  305. ^C      G_Value = 
  306. shell_SliderGetValue( _m_ColourPick_SliderG% )
  307. _C      B_Value = 
  308. shell_SliderGetValue( _m_ColourPick_SliderB% )
  309. `        
  310. b)    
  311.  _m_ColourPick_NotifyFN$ <> "" 
  312. ct      void% = 
  313. ( "FN" + _m_ColourPick_NotifyFN$ + "( " + 
  314.  R_Value + ", " + 
  315.  G_Value + ", "+ 
  316.  B_Value + " )" )
  317. d        
  318. j&*|Stop FN_ColourPicker_ClickAdjust
  319. n"*|Start FN_ColourPicker_Redraw
  320. _ColourPicker_Redraw( redraw_blk%, x0%, y0% )
  321.  Palette_Entry%, R_Value, G_Value, B_Value, loop%
  322. shell_ColourPickerUsingStandard = 
  323.   nr_lines% = 24
  324.   spacing%  = 16
  325.   offset%   = 9
  326. shell_IsIconSelected( _m_ColourPick_DBoxHandle%, _m_ColourPick_None_Icon% ) 
  327. xL    
  328.  x0% + _m_ColourPick_Patch_X_Min%, y0% + _m_ColourPick_Patch_Y_Min%
  329. yL    
  330.  x0% + _m_ColourPick_Patch_X_Max%, y0% + _m_ColourPick_Patch_Y_Min%
  331. zL    
  332.  x0% + _m_ColourPick_Patch_X_Max%, y0% + _m_ColourPick_Patch_Y_Max%
  333. {L    
  334.  x0% + _m_ColourPick_Patch_X_Min%, y0% + _m_ColourPick_Patch_Y_Max%
  335. |L    
  336.  x0% + _m_ColourPick_Patch_X_Min%, y0% + _m_ColourPick_Patch_Y_Min%
  337.  loop% = 0 
  338.  nr_lines%
  339. ~d      
  340.  x0% + _m_ColourPick_Patch_X_Min% + (loop% * spacing% ), y0% + _m_ColourPick_Patch_Y_Min%
  341. o      
  342.  x0% + _m_ColourPick_Patch_X_Min% + (loop% * spacing% ) + spacing%, y0% + _m_ColourPick_Patch_Y_Max%
  343.  loop%
  344. H    R_Value = 
  345. shell_SliderGetValue( _m_ColourPick_SliderR% ) * 2.55
  346. H    G_Value = 
  347. shell_SliderGetValue( _m_ColourPick_SliderG% ) * 2.55
  348. H    B_Value = 
  349. shell_SliderGetValue( _m_ColourPick_SliderB% ) * 2.55
  350. Q    Palette_Entry% = ( B_Value << 24 ) + ( G_Value << 16 ) + ( R_Value << 8 )
  351. <    
  352.  "ColourTrans_SetGCOL", Palette_Entry%, , , 256, 0
  353.  x0% + _m_ColourPick_Patch_X_Min%, y0% + _m_ColourPick_Patch_Y_Min%, _m_ColourPick_Patch_X_Max% - _m_ColourPick_Patch_X_Min%, _m_ColourPick_Patch_Y_Max% - _m_ColourPick_Patch_Y_Min%
  354. !*|Stop FN_ColourPicker_Redraw
  355. +*|Start PROCshell_ColourPickerSetColour
  356. shell_ColourPickerSetColour( R_Value, G_Value, B_Value )
  357. shell_ColourPickerUsingStandard = 
  358. shell_SliderSetValue( _m_ColourPick_SliderR%, R_Value )
  359. shell_SliderSetValue( _m_ColourPick_SliderG%, G_Value )
  360. shell_SliderSetValue( _m_ColourPick_SliderB%, B_Value )
  361.  IF INKEY(-1) THEN ERROR 99,STR$R_Value+":"+STR$G_Value+":"+STR$B_Value
  362. **|Stop PROCshell_ColourPickerSetColour
  363. $*|Start FN_ColourPick_IconWatch1
  364. _ColourPick_IconWatch1( value$ )
  365. shell_ColourPickerUsingStandard = 
  366. shell_SliderSetValue( _m_ColourPick_SliderR%, 
  367. ( value$ ) )
  368. #*|Stop FN_ColourPick_IconWatch1
  369. $*|Start FN_ColourPick_IconWatch2
  370. _ColourPick_IconWatch2( value$ )
  371. shell_ColourPickerUsingStandard = 
  372. shell_SliderSetValue( _m_ColourPick_SliderG%, 
  373. ( value$ ) )
  374. #*|Stop FN_ColourPick_IconWatch2
  375. $*|Start FN_ColourPick_IconWatch3
  376. _ColourPick_IconWatch3( value$ )
  377. shell_ColourPickerUsingStandard = 
  378. shell_SliderSetValue( _m_ColourPick_SliderB%, 
  379. ( value$ ) )
  380. #*|Stop FN_ColourPick_IconWatch3
  381. ,*|Start FNshell_ColourPickerModuleLoaded
  382. shell_ColourPickerModuleLoaded
  383.  Routine to check whether the Acorn 'Colour Picker' module is available.
  384.  Returns TRUE is it is, FALSE otherwise.
  385.  len%,result$, return_code%
  386. ( "Set Module$Check Y" )
  387. ( "RMEnsure ColourPicker 0.15 Set Module$Check N" )
  388.  "OS_ReadVarVal","Module$Check", _m_ColourPick_OSVarBuffer%, _m_ColourPick_OSVarLen%, 0 , 0 
  389.  , , len%
  390. >_m_ColourPick_OSVarBuffer%?len% = _m_ColourPick_OSVarTerm%
  391. ( "Unset Module$Check" )
  392. )result$ = $_m_ColourPick_OSVarBuffer%
  393.  result$ = "N" 
  394.   return_code% = 
  395.   return_code% = 
  396. = return_code%
  397. +*|Stop FNshell_ColourPickerModuleLoaded
  398. 0*|Start PROCshell_ColourPickerUseNonStandard
  399. shell_ColourPickerUseNonStandard
  400. '_m_ColourPick_DBox$ = "NonStandard"
  401. /*|Stop PROCshell_ColourPickerUseNonStandard
  402. -*|Start PROCshell_ColourPickerUseStandard
  403. shell_ColourPickerUseStandard
  404. shell_ColourPickerModuleLoaded 
  405. &  _m_ColourPick_DBox$ = "Standard"
  406. )  _m_ColourPick_DBox$ = "NonStandard"
  407. ,*|Stop PROCshell_ColourPickerUseStandard
  408. -*|Start FNshell_ColourPickerUsingStandard
  409. shell_ColourPickerUsingStandard
  410.  return_code%
  411.  _m_ColourPick_DBox$ = "Standard" 
  412.   return_code% = 
  413.   return_code% = 
  414. = return_code%
  415. ,*|Stop FNshell_ColourPickerUsingStandard
  416. +*|Start PROCshell_ColourPickerSelection
  417. shell_ColourPickerSelection( palette_entry%, colour_none_selected% )
  418.  Called when OK has been selected in the Acorn colour picker
  419.  dialogue box only..
  420.  void%, R_Value, G_Value, B_Value
  421.  colour_none_selected% = 
  422. 1  !_m_ColourPick_PaletteBlk% = palette_entry%
  423. 6  B_Value = ( _m_ColourPick_PaletteBlk%?3 ) / 2.55
  424. 6  G_Value = ( _m_ColourPick_PaletteBlk%?2 ) / 2.55
  425. 6  R_Value = ( _m_ColourPick_PaletteBlk%?1 ) / 2.55
  426.   B_Value = -1
  427.   G_Value = -1
  428.   R_Value = -1
  429.  _m_ColourPick_NotifyFN$ <> "" 
  430. p  void% = 
  431. ( "FN" + _m_ColourPick_NotifyFN$ + "( " + 
  432.  R_Value + ", " + 
  433.  G_Value + ", "+ 
  434.  B_Value + " )" )
  435. **|Stop PROCshell_ColourPickerSelection
  436.